home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Controls
/
Visual Basic Controls.iso
/
vbcontrol
/
asppw112
/
fdinfo.asp
< prev
next >
Wrap
Text File
|
1999-01-07
|
3KB
|
76 lines
<HTML><BODY>
<%
' GetFileInfo(ByVal vsFilePathName As String) As CFile
' output: CFile Object Succeed
' Nothing Failure
' Sample Operation:
' Get file or directory information.
' Note: Class CFile properties:
' Name as string
' Length as long
' Attr as Integer
' CreationTime as string
' LastWriteTime as string
' LastAccessTime as string
'
' This file is provided as part of ASP Power Widgets Samples
'
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT
' WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
' INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
' OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
' PURPOSE.
' Copyright 1997-1998. All rights reserved.
' Dalun Software Inc. ASP Power Widgets
' http://www.dalun.com
' http://members.tripod.com/ActiveServerPage/
vbNormal = 0 'Normal
vbReadOnly = 1 'Read-only
vbHidden = 2 'Hidden
vbSystem = 4 'System
vbDirectory = 16 'Directory or folder
vbArchive = 32 'File has changed since last backup
response.write "<p><h2>File/Directory Information Demo.</h2></p>"
Set oFDMgt = Server.CreateObject("ASPPW.FDMgt")
set oFInfo= oFDMgt.GetFileInfo ( oFDMgt.GetWindowsDirectory + "\win.ini" )
if oFInfo is Nothing then
response.write oFDMgt.GetWindowsDirectory + "\win.ini not found.<br>"
else
nAttr=oFInfo.attr
if nAttr And vbReadOnly then
sAttr=sAttr & "R "
end if
if nAttr And vbHidden then
sAttr=sAttr & "H "
end if
if nAttr And vbSystem then
sAttr=sAttr & "S "
end if
if nAttr And vbArchive then
sAttr=sAttr & "A "
end if
response.write "<font size=2 face=""Courier New"">" & oFInfo.Name & " attribute is: " & sAttr & "</font><br>"
response.write "<font size=2 face=""Courier New"">File length : " & oFInfo.Length & " bytes. <br>"
response.write "<font size=2 face=""Courier New"">Creation Time: " & oFInfo.CreationTime & ".<br>"
response.write "<font size=2 face=""Courier New"">LastWrite Time: " & oFInfo.LastWriteTime & ".<br>"
response.write "<font size=2 face=""Courier New"">LastAccess Time: " & oFInfo.LastAccessTime & ".<br>"
set oFInfo = Nothing
end if
Set oFDMgt = Nothing
%>
</BODY></HTML>